import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-03-20
 * Time: 16:50
 */

public class Test2 {
    public static void main(String[] args) {
        Scanner q=new Scanner(System.in);
        int n=q.nextInt();
        int[] arr=new int[3 * n];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=q.nextInt();
        }
        Arrays.sort(arr);
        long a=0;
        for (int i = n; i < arr.length; i+=2) {
            a+=arr[i];
        }
        System.out.println(a);
    }
}
